package cnu.ldc.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class ByteSystemTest {
	
	public static void main(String[] args) {
		File fi=new File("d:\\1.txt");

		try {
			System.out.println(fi.createNewFile());
			InputStream fis=new FileInputStream(fi);
			OutputStream fos=new FileOutputStream("d:\\2.txt",true);
//			System.out.println((char)fis.read());
			byte[] b=new byte[6];
			int lenth=0;
//			fis.read(b);
			while((lenth=fis.read(b))!=-1) {
			fos.write(b);
			for(int i=0;i<b.length;i++) {
				System.out.print((char)b[i]);
			}
			System.out.println();
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
